package com.cspg.ssss.job;

import com.cspg.ssss.service.DaiBanService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.text.ParseException;

/**
 * 待办数据更新Job
 */
public class DaiBanJob extends QuartzJobBean {
    private static final Logger log = LoggerFactory.getLogger(DaiBanJob.class);

    @Autowired
    DaiBanService daiBanService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("start DaiBanJob ......++ ");
        try {
            //更新公司待办事项
            daiBanService.updateBacklogList(0);
            //更新单位待办事项
            daiBanService.updateBacklogList(1);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        log.info("end DaiBanJob ......++ ");
    }
}
